local Lua__lwjw = fk.CreateSkill {

  name = "Lua__lwjw",

  tags = { Skill.Compulsory, },

}

Fk:loadTranslationTable{
    ["Lua__lwjw"] = "来我家玩",
    ["$Lua__lwjw1"] = "我的房子还蛮大的",
    ["$Lua__lwjw2"] = "去超商",
    ["#Lua__ajzjAura"] = "来我家玩",
    [":Lua__lwjw"] = "锁定技，当你获得牌时，若你的手牌数为全场最多，你开启“阿杰之家”光环，直至有角色死亡。（阿杰之家：当一名角色体力值变动时随机弃置两张牌）",
    ["@[:]ajiezhijia"] = "阿杰之家",
    ["guanghuan"] = "光环",
    [":guanghuan"] = "当一名角色体力值变动时随机弃置两张牌",
    
}

Lua__lwjw:addEffect(fk.AfterCardsMove, {
    anim_type = "special",
    can_trigger = function(self, event, target, player, data)
        local room = player.room
        for _, move in ipairs(data) do
            if move.to and move.to == player and move.toArea == Card.PlayerHand then
                if table.every(room:getOtherPlayers(player), function(p) return player:getHandcardNum() > p:getHandcardNum() end) then
                    return player:hasSkill(Lua__lwjw.name) and room:getBanner("@[:]ajiezhijia") == nil
                end
            end
        end
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        room:setBanner("@[:]ajiezhijia", "guanghuan")
    end,
})
Lua__lwjw:addEffect(fk.Deathed, {
    anim_type = "special",
    can_trigger = function(self, event, target, player, data)
        local room = player.room
        return player:hasSkill(self, false, true) and room:getBanner("@[:]ajiezhijia") ~= nil
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        room:setBanner("@[:]ajiezhijia", nil)
        room:setBanner("@[:]ajiezhijia", 0)
    end,
})

Lua__lwjw:addEffect(fk.HpChanged, {
    mute = true,
    global = true,
    can_trigger = function(self, event, target, player, data)
        local room = player.room
        if room:getBanner("@[:]ajiezhijia") == nil then return false end
        if room:getBanner("@[:]ajiezhijia") ~= nil then
            return target == player and not player:isNude()
        end
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        local canDiscard = table.filter(player:getCardIds("h"), function(id) return not player:prohibitDiscard(Fk:getCardById(id)) end)
        if #canDiscard then
            room:throwCard(table.random(canDiscard, 2), Lua__lwjw.name, player, player)
        end

    end,
})

return Lua__lwjw